package flc.ast.fragment;

import android.view.View;

import androidx.fragment.app.Fragment;

import flc.ast.R;
import flc.ast.activity.CameraActivity;
import flc.ast.activity.SelPicActivity;
import flc.ast.databinding.FragmentHomeBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;
import stark.common.basic.utils.StatusBarUtils;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link HomeFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class HomeFragment extends BaseNoModelFragment<FragmentHomeBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);
        StatusBarUtils.setSystemStatusTextColor(true, getActivity());
        mDataBinding.llTakePic.setOnClickListener(this);
        mDataBinding.ivPicSticker.setOnClickListener(this);
        mDataBinding.ivPicAnimation.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.llTakePic://拍摄
                startActivity(CameraActivity.class);
                break;
            case R.id.ivPicSticker://图片贴纸
                SelPicActivity.type = 0;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicAnimation://动漫特效
                SelPicActivity.type = 1;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}